package com.jinzhi.jzweb.controller.moduleConfig;


import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.BaseController;
import com.jinzhi.common.utils.Result;
import com.jinzhi.jzweb.domain.ExaminationResultsComDO;
import com.jinzhi.jzweb.pojo.ExaminationResultsPoVo;
import com.jinzhi.jzweb.service.ExaminationResultsComService;
import com.jinzhi.jzweb.service.StuSignUpComService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;

/**
 * 实操回应性生活照护分数统计
 * </pre>
 * <small> 2023-05-05 15:11:09 | lance</small>
 */
@Controller
@RequestMapping("/jzweb/examinationAnswerSheetComJuJia")
@Api(value = "实操回应性生活照护分数统计", tags = {"实操回应性生活照护分数统计"})
public class ExaminationAnswerSheetComJuJiaController extends BaseController {

    @Autowired
    private ExaminationResultsComService examinationResultsService;


    /**
     * 职业素养测评成绩统计导出
     *
     * @param response
     */
    @ApiOperation(value = "实操回应性生活照护分数统计导出", notes = "实操回应性生活照护分数统计导出")
    @GetMapping("/downloadImportStu")
    @RequiresPermissions("jzweb:examinationAnswerSheetComJuJia:import")
    @ResponseBody
    public void downloadImportTemplate(HttpServletResponse response, ExaminationResultsComDO examinationAnswerSheetComDT) {

        examinationResultsService.juJiaDownloadImport(response,examinationAnswerSheetComDT);
    }

    /**
     * 超级管理员 一级管理员查看分数
     * @param model
     * @return
     */
    @GetMapping()
    @RequiresPermissions("jzweb:examinationAnswerSheetCom:examinationAnswerSheetComJuJia")
    String info( Model model) {
        return "jzweb/examinationAnswerSheetComJuJia/examinationAnswerSheetComJuJia";
    }

    /**
     * 实操回应性生活照护分数统计
     * @param examinationAnswerSheetComDTO
     * @return
     */
    @ResponseBody
    @GetMapping("/list")
    @RequiresPermissions("jzweb:examinationAnswerSheetCom:examinationAnswerSheetComJuJia")
    public Result<Page<ExaminationResultsPoVo>> list(ExaminationResultsComDO examinationAnswerSheetComDTO){

        return Result.ok(examinationResultsService.juJiaStatistics(examinationAnswerSheetComDTO));
    }

}
